package com.techfork.hutool.teck;

import cn.hutool.Hutool;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.techfork.hutool.teck.base.MyFunction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;

@Slf4j
public class TestHutool {
    /**
     * hutool 工具集测试入口
     *
     * @param args
     * @see <a href="https://flowus.cn/1b5f36d2-4079-4838-ad97-9007ce9c1be4#fd063336-2f16-480c-b1f0-c268e4f826db">...</a>
     * @see <a href="https://www.hutool.cn/">...</a>
     */
    public static void main(String[] args) {
        // poi 另一个项目


        handle(Usage::ioUtilTest);
//        handle(Usage::builderUtilTest);
//        handle(Usage::beanUtilTest);
//        handle(Usage::strUtilTest);
//        handle(Usage::collectionUtilTest);
//        handle(Usage::dateUtilTest);
//        handle(Usage::imageUtilTest);
//        handle(Usage::captchaUtilTest);
//        handle(Usage::taskUtilTest);
//        handle(Usage::systemUtilTest);
//        handle(Usage::httpUtilTest);
    }

    private static void handle(MyFunction function) {
        String name = function.getImplMethodName();
        System.out.printf("======================start: %s=======================%n", name);
        try {
            function.run();
        } catch (Exception e) {
            log.error("{}: {}", name, e.getMessage());
        }
        System.out.printf("======================end:   %s=======================%n", name);

    }
}
